<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 属性独立，方法共享
      const hamster = {
        stomach: [],
        eat(food) {
          this.stomach.push(food);
        },
      };
      const speed = {
        stomach: [],
        __proto__: hamster,
      };
      const lazy = {
        stomach: [],
        __proto__: hamster,
      };
      speed.eat("apple"); // speed.stomach.push(food);
      console.log(speed.stomach);
      console.log(lazy.stomach);
      console.log(hamster.stomach);

      // hamster.eat("apple");
      // hamster.eat("banana");
      // console.log(hamster.stomach);
    </script>
  </body>
</html>
